<template>
	<view class="p-10">
		<z-paging ref="paging" use-page-scroll @query='getList' v-model='list'>
			<view class="mb-10 bg-white rounded-12 p-12 flex flex-x-space-between flex-y-center"
				v-for="(item,index) in list" :key='index'>
				<view class="flex flex-column">
					<text>{{item?.testPaper.name}}</text>
					<text class="fs-12 text-grey-1 pt-10">共{{item.topic_num}}题</text>
					<view class="mt-10 fs-14  text-grey-3  flex">
						<view class="flex">
							<uv-icon name="checkmark-circle" color="#3D5CFF"></uv-icon>
							<text class="text-blue-1">{{item.correct}}题</text>
						</view>
						<view class="flex ml-20">
							<uv-icon name="close-circle" color="#EA4545"></uv-icon>
							<text class="text-red-1 ">{{item.wrong}}题</text>
						</view>
					</view>
				</view>
				<view>
					<view class="px-12 py-4 rounded-30  fs-14 bg-blue-1 text-white"
						@click="$page.open('/pages/topic/topic?testPaperId='+item.id)" v-if="item.wrong!=0">查看错题</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script setup>
	import useZPaging from "@/uni_modules/z-paging/components/z-paging/js/hooks/useZPaging.js";
	import { ref } from 'vue';
	import { $http ,$page} from '@/utils'
	import { onReachBottom, onPageScroll } from '@dcloudio/uni-app'
	const list = ref()
	const paging = ref()
	useZPaging(paging)
	const getList = () => {
		$http.get('TestPaper/getTestPaperRecord').then(res => {
			paging.value.complete(res.data)
		})
	}
</script>

<style>

</style>